.#115
Conversation
|
@CollinsKRO is attempting to deploy a commit to the emrekayat's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the PR. I reviewed the diff from the maintainer account, but this is not merge-ready. The PR claims to close #88, but the current diff only changes: There is no implementation or test coverage for the issue, and the PR title is just |
- Add GET /api/export endpoint returning sanitized analytics - Export includes: total queries, spend by mode/provider, demo/paid/failed counts, payment evidence count, timestamp - No raw payment headers, wallet secrets, or provider credentials - Empty analytics returns valid export with zero totals - Tests assert secret-like fields are excluded - Add Download JSON button to ControlDeckPage
|
Rechecked: after the other PRs were merged this one now has merge conflicts with |
closes #88
Summary
Add a read-only JSON export endpoint for sanitized usage and spend analytics, making it easy for SCF reviewers and investors to verify usage without exposing sensitive data.
Changes
API —
GET /api/exportexportedAttotalQueriestotalSpendUsdspendByModesearch,news,scrape)spendByProviderqueryCountByStatusdemo,paid, orfailedpaymentEvidenceCountNo raw payment headers, wallet secrets, facilitator URLs, or provider credentials are included.
Files touched
apps/api/src/lib/persistence.ts— AddedAnalyticsExportinterface andgetAnalyticsExport()functionapps/api/src/routes/public.ts— AddedGET /api/exportrouteapps/api/src/routes/public.test.ts— 3 tests:apps/web/src/pages/ControlDeckPage.tsx— Added "Export JSON" download buttonapps/web/src/styles.css— Styling for export buttonTesting
# Run the public route tests npx vitest run apps/api/src/routes/public.test.tsAll 15 tests pass (12 existing + 3 new).